﻿<sap:ActivityDesigner x:Class="Vision.Core.ActivityComponents.Sql.SqlExecuteScalarDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    xmlns:s="clr-namespace:System;assembly=mscorlib" 	
    xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
    xmlns:sqlcleint="clr-namespace:System.Data.SqlClient;assembly=System.Data"
    xmlns:sc="clr-namespace:System.Collections;assembly=mscorlib" 
	xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" 
    xmlns:converters="clr-namespace:Vision.Core.ActivityComponents.Converters"
    xmlns:custom="clr-namespace:Vision.Core.ActivityComponents.Common"                      
    Collapsible="True" Icon="{DynamicResource DesignerIcon}">
    <sap:ActivityDesigner.Resources>
        <ResourceDictionary x:Uid="ResourceDictionary_1">
            <sapc:ArgumentToExpressionConverter x:Uid="sadv:ArgumentToExpressionConverter_1" x:Key="argumentToExpressionConverter" />
            <DataTemplate x:Uid="DataTemplate_1" x:Key="ExpandedFileSaveTemplate">
                <StackPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100" />
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="22"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="24" />
                            <RowDefinition Height="24" />
                            <RowDefinition Height="24" />
                            <RowDefinition Height="24" />
                        </Grid.RowDefinitions>

                        <!-- Inputs Header -->
                        <TextBlock Grid.Row="0" Grid.ColumnSpan="2" x:Uid="Header_1" Text="Input(s):" FontWeight="Bold" Foreground="Navy" Margin="0,0,0,3" />

                        <!-- ModelItem.SqlConn -->
                        <TextBlock Grid.Row="1" Grid.Column="0" Text="SqlConnection:" VerticalAlignment="Center" />
                        <sapv:ExpressionTextBox Grid.Row="1" Grid.Column="1" MaxLines="1" Margin="7,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                Expression="{Binding Path=ModelItem.SqlConn, Mode=TwoWay, Converter={StaticResource argumentToExpressionConverter}, ConverterParameter=In}"                                
                                ExpressionType="{Binding Path=ModelItem.SqlConn.ArgumentType}"                                                
                                OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}" />
                        <custom:TypeBrowserButton  Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" BrowserType="{Binding Path=ModelItem.SqlConn.ArgumentType}"/>

                        <!-- ModelItem.SqlCmdText -->
                        <TextBlock Grid.Row="2" Grid.Column="0" Text="SqlCmdText:" VerticalAlignment="Center" />
                        <sapv:ExpressionTextBox Grid.Row="2" Grid.Column="1" MaxLines="1" Margin="7,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                Expression="{Binding Path=ModelItem.SqlCmdText, Mode=TwoWay, Converter={StaticResource argumentToExpressionConverter}, ConverterParameter=In}"
                                ExpressionType="{Binding Path=ModelItem.SqlCmdText.ArgumentType}"
                                OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}"/>
                        <custom:TypeBrowserButton  Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" BrowserType="{Binding Path=ModelItem.SqlCmdText.ArgumentType}"/>

                        <!-- ModelItem.SqlParameters -->
                        <TextBlock Grid.Row="3" Grid.Column="0" Text="SqlParameters:" VerticalAlignment="Center" />
                        <sapv:ExpressionTextBox Grid.Row="3" Grid.Column="1" MaxLines="1" Margin="7,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                Expression="{Binding Path=ModelItem.SqlParameters, Mode=TwoWay, Converter={StaticResource argumentToExpressionConverter}, ConverterParameter=In}"
                                ExpressionType="{Binding Path=ModelItem.SqlParameters.ArgumentType}"                                                                                
                                OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}"/>
                        <custom:TypeBrowserButton  Grid.Row="3" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" BrowserType="{Binding Path=ModelItem.SqlParameters.ArgumentType}"/>
                    </Grid>
                    <Border BorderThickness="0,0,0,3" Margin="0,5">
                        <Border.BorderBrush>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="DarkGray" Offset="0" />
                                <GradientStop Color="White" Offset="1" />
                            </LinearGradientBrush>
                        </Border.BorderBrush>
                    </Border>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100" />
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="22"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Text="Body Argument:" Foreground="Gray"/>
                        <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=ModelItem.Body.Argument.Name, Mode=TwoWay}" Margin="7,0,0,0" Foreground="Gray" VerticalAlignment="Center"/>
                        <custom:TypeBrowserButton  Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" BrowserType="{Binding Path=ModelItem.Body.Argument.Type}"/>
                    </Grid>
                    <!-- Body -->
                    <sap:WorkflowItemPresenter AutomationProperties.AutomationId="Activity" IsDefaultContainer="True" HintText="Drop activity here" Item="{Binding Path=ModelItem.Body.Handler, Mode=TwoWay}" AllowedItemType="{x:Type sa:Activity}" MinWidth="100" MinHeight="100" Margin="0,7,0,0"/>
                </StackPanel>
            </DataTemplate>
            <DataTemplate x:Uid="DataTemplate_2" x:Key="CollapsedActivityViewTemplate">
                <Label x:Uid="TextBlock_6" Padding="0,0,0,0" FontStyle="Italic" Foreground="{x:Static SystemColors.GrayTextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center">Double-click to view</Label>
            </DataTemplate>
            <Style x:Uid="Style_1" x:Key="SqlDataReaderStyle" TargetType="{x:Type ContentPresenter}">
                <Setter x:Uid="Setter_1" Property="ContentTemplate" Value="{DynamicResource CollapsedActivityViewTemplate}" />
                <Style.Triggers>
                    <DataTrigger x:Uid="DataTrigger_1" Binding="{Binding Path=ShowExpanded}" Value="true">
                        <Setter x:Uid="Setter_2" Property="ContentTemplate" Value="{DynamicResource ExpandedFileSaveTemplate}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <DrawingBrush x:Key="DesignerIcon" Stretch="Uniform">
                <DrawingBrush.Drawing>
                    <DrawingGroup>
                        <DrawingGroup Transform="1,0,0,1,-237.265747070313,-218.389343261719">
                            <DrawingGroup Transform="3.01926493644714,0,0,3.01926493644714,-1422.41796875,-183.667205810547">
                                <DrawingGroup Transform="0.470916002988815,0,0,0.482165992259979,442.119110107422,4.5951681137085">
                                    <GeometryDrawing Geometry="F1M442.857,306.648A107.143,40.000,0.000,1,1,228.571,306.648A107.143,40.000,0.000,1,1,442.857,306.648z">
                                        <GeometryDrawing.Brush>
                                            <LinearGradientBrush StartPoint="233.934,346.648" EndPoint="313.08,306.648" MappingMode="Absolute" SpreadMethod="Pad">
                                                <GradientStop Color="Black" Offset="0" ></GradientStop>
                                                <GradientStop Color="#FF93969E" Offset="1" ></GradientStop>
                                            </LinearGradientBrush>
                                        </GeometryDrawing.Brush>
                                    </GeometryDrawing>
                                </DrawingGroup>
                                <DrawingGroup Transform="0.470916002988815,0,0,0.482165992259979,442.119110107422,44.635368347168">
                                    <GeometryDrawing Geometry="F1M442.857,306.648A107.143,40.000,0.000,1,1,228.571,306.648A107.143,40.000,0.000,1,1,442.857,306.648z">
                                        <GeometryDrawing.Brush>
                                            <LinearGradientBrush StartPoint="233.934,346.648" EndPoint="313.08,306.648" MappingMode="Absolute" SpreadMethod="Pad">
                                                <GradientStop Color="Black" Offset="0" ></GradientStop>
                                                <GradientStop Color="#FF93969E" Offset="1" ></GradientStop>
                                            </LinearGradientBrush>
                                        </GeometryDrawing.Brush>
                                    </GeometryDrawing>
                                </DrawingGroup>
                                <GeometryDrawing Geometry="F1M650.561,148.227C650.563,148.294 650.561,148.355 650.561,148.422 650.561,159.069 627.966,167.709 600.114,167.709 573.242,167.709 551.241,159.665 549.728,149.537L549.728,176.689C549.726,176.728 549.731,176.771 549.728,176.810 549.711,177.016 549.698,177.220 549.698,177.428 549.698,188.074 572.322,196.714 600.190,196.714 627.332,196.714 649.485,188.519 650.621,178.256 650.622,178.255 650.621,178.243 650.621,178.241 650.624,178.221 650.633,178.187 650.636,178.166 650.688,178.016 650.727,177.852 650.727,177.684L650.727,148.920C650.727,148.669,650.672,148.432,650.561,148.227z">
                                    <GeometryDrawing.Brush>
                                        <LinearGradientBrush StartPoint="549.698,172.47" EndPoint="650.727,172.47" MappingMode="Absolute" SpreadMethod="Pad">
                                            <GradientStop Color="Gainsboro" Offset="0" ></GradientStop>
                                            <GradientStop Color="#FFA0A0A0" Offset="0.118" ></GradientStop>
                                            <GradientStop Color="#FFD9DADA" Offset="0.236" ></GradientStop>
                                            <GradientStop Color="#FF838686" Offset="0.472" ></GradientStop>
                                            <GradientStop Color="#FFC8C5C8" Offset="1" ></GradientStop>
                                        </LinearGradientBrush>
                                    </GeometryDrawing.Brush>
                                </GeometryDrawing>
                                <DrawingGroup Transform="0.470916002988815,0,0,0.482165992259979,442.119110107422,84.6754837036133">
                                    <GeometryDrawing Geometry="F1M442.857,306.648A107.143,40.000,0.000,1,1,228.571,306.648A107.143,40.000,0.000,1,1,442.857,306.648z">
                                        <GeometryDrawing.Brush>
                                            <LinearGradientBrush StartPoint="233.934,346.648" EndPoint="313.08,306.648" MappingMode="Absolute" SpreadMethod="Pad">
                                                <GradientStop Color="Black" Offset="0" ></GradientStop>
                                                <GradientStop Color="#FF93969E" Offset="1" ></GradientStop>
                                            </LinearGradientBrush>
                                        </GeometryDrawing.Brush>
                                    </GeometryDrawing>
                                </DrawingGroup>
                                <GeometryDrawing Geometry="F1M650.561,188.267C650.563,188.334 650.561,188.395 650.561,188.463 650.561,199.109 627.966,207.749 600.114,207.749 573.242,207.749 551.241,199.706 549.728,189.578L549.728,216.730C549.726,216.768 549.731,216.811 549.728,216.850 549.711,217.056 549.698,217.260 549.698,217.468 549.698,228.114 572.322,236.755 600.190,236.755 627.332,236.755 649.485,228.559 650.621,218.297 650.622,218.296 650.621,218.283 650.621,218.282 650.624,218.261 650.633,218.228 650.636,218.206 650.688,218.057 650.727,217.892 650.727,217.724L650.727,188.960C650.727,188.709,650.672,188.472,650.561,188.267z">
                                    <GeometryDrawing.Brush>
                                        <LinearGradientBrush StartPoint="549.698,212.511" EndPoint="650.727,212.511" MappingMode="Absolute" SpreadMethod="Pad">
                                            <GradientStop Color="Gainsboro" Offset="0" ></GradientStop>
                                            <GradientStop Color="#FFA0A0A0" Offset="0.118" ></GradientStop>
                                            <GradientStop Color="#FFD9DADA" Offset="0.236" ></GradientStop>
                                            <GradientStop Color="#FF838686" Offset="0.472" ></GradientStop>
                                            <GradientStop Color="#FFC8C5C8" Offset="1" ></GradientStop>
                                        </LinearGradientBrush>
                                    </GeometryDrawing.Brush>
                                </GeometryDrawing>
                                <GeometryDrawing Geometry="F1M650.561,228.307C650.563,228.374 650.561,228.435 650.561,228.503 650.561,239.149 627.966,247.789 600.114,247.789 573.242,247.789 551.241,239.746 549.728,229.618L549.728,256.770C549.726,256.808 549.731,256.852 549.728,256.890 549.711,257.097 549.698,257.300 549.698,257.508 549.698,268.154 572.322,276.795 600.190,276.795 627.332,276.795 649.485,268.599 650.621,258.337 650.622,258.336 650.621,258.323 650.621,258.322 650.624,258.302 650.633,258.268 650.636,258.246 650.688,258.097 650.727,257.932 650.727,257.764L650.727,229.000C650.727,228.750,650.672,228.512,650.561,228.307z">
                                    <GeometryDrawing.Brush>
                                        <LinearGradientBrush StartPoint="549.698,252.551" EndPoint="650.727,252.551" MappingMode="Absolute" SpreadMethod="Pad">
                                            <GradientStop Color="Gainsboro" Offset="0" ></GradientStop>
                                            <GradientStop Color="#FFA0A0A0" Offset="0.118" ></GradientStop>
                                            <GradientStop Color="#FFD9DADA" Offset="0.236" ></GradientStop>
                                            <GradientStop Color="#FF838686" Offset="0.472" ></GradientStop>
                                            <GradientStop Color="#FFC8C5C8" Offset="1" ></GradientStop>
                                        </LinearGradientBrush>
                                    </GeometryDrawing.Brush>
                                </GeometryDrawing>
                            </DrawingGroup>
                        </DrawingGroup>
                    </DrawingGroup>
                </DrawingBrush.Drawing>
            </DrawingBrush>
        </ResourceDictionary>
    </sap:ActivityDesigner.Resources>
    <ContentPresenter x:Uid="ContentPresenter_1" Style="{DynamicResource SqlDataReaderStyle}" Content="{Binding}" />
</sap:ActivityDesigner>
